package com.enjoybyte.pangucloud.demo.controller;

import com.enjoybyte.pangucloud.demo.domain.UserDemo;
import com.enjoybyte.pangucloud.demo.service.IUserDemoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 系统用户表 前端控制器
 * </p>
 *
 * @author lijunjie
 * @since 2024-06-25
 */
@RestController
@RequestMapping("/userDemo")
@Tag(name = "系统用户")
@RequiredArgsConstructor
public class UserDemoController {

    private final IUserDemoService userDemoService;

    @Operation
    @GetMapping("list")
    public List<UserDemo> list(){
        return userDemoService.list();
    }

    @Operation
    @GetMapping("getUserByid/{id}")
    public UserDemo getUserByid(@PathVariable Long id){
        return userDemoService.getById(id);
    }

}
